<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>echarts-多折线图</title>
        <script type="text/javascript" src="jquery-1.4.2.min.js" ></script>
        <script type="text/javascript" src="echarts.js" ></script>
        <style>
            body,html{
                width: 99%;
                height: 99%;
                font-family: "微软雅黑";
                font-size: 12px;
				
			
            }
            #someline{
                width:100%;
                height:99%;
            }
        </style>
        <script>
            $(document).ready(function(){
                var chart = document.getElementById("someline");
                var echart = echarts.init(chart);
                var option = {
    title : {
        text: '未来趋势图',
        subtext: '请以医院检测为主'
    },
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:['血糖','总胆固醇','尿酸','心率','体温','血压']
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['周一','周二','周三','周四','周五','周六','周日']
        }
    ],
    yAxis : [
        {
            type : 'value',
            axisLabel : {
                formatter: '{value} °C'
            }
        }
    ],
    series : [
        {
            name:'血糖',
            type:'line',
            data:[11, 11, 15, 13, 12, 13, 10],
            markPoint : {
                data : [
                    {type : 'max', name: '最大值'},
                    {type : 'min', name: '最小值'}
                ]
            },
            markLine : {
                data : [
                    {type : 'average', name: '平均值'}
                ]
            }
        },
        {
            name:'总胆固醇',
            type:'line',
            data:[1, -2, 2, 5, 3, 2, 0],
            markPoint : {
                data : [
                    {name : '周最低', value : -2, xAxis: 1, yAxis: -1.5}
                ]
            },
            markLine : {
                data : [
                    {type : 'average', name : '平均值'}
                ]
            }
          
        },
        {
            name:'尿酸',
            type:'line',
            data:[1, -2, 2, 5, 3, 2, 0],
            markPoint : {
                data : [
                    {name : '周最低', value : -2, xAxis: 1, yAxis: -1.5}
                ]
            },
            markLine : {
                data : [
                    {type : 'average', name : '平均值'}
                ]
            }
          
        }
    ]
};
                echart.setOption(option);
            });
        </script>
    </head>
    <body>
        <div id="someline"></div>
    </body>
</html>
